﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using DevExpress.XtraGrid;
namespace Fcdbas.WinUI.Common
{
    public class GridSetting
    {
        public GridSetting()
        {
            ColumnSettings = new List<GridColumnSetting>();
            FormatConditions = new List<GridFormatCondition>();
            //ViewOption = new GridViewOption();
        }
        public List<GridColumnSetting> ColumnSettings { get; set; }
        public List<GridFormatCondition> FormatConditions { get; set; }
        //public GridViewOption ViewOption { get; set; }
    }
    public class GridColumnSetting
    {
        public GridColumnSetting( DevExpress.Utils.HorzAlignment align)
        {

            Alignment = new Fcdbas.WinUI.Controls.ComboBoxData();
            Alignment.Value = align;

            switch (align)
            {
                case DevExpress.Utils.HorzAlignment.Default:
                    Alignment.Text = "默认";
                    break;
                case DevExpress.Utils.HorzAlignment.Center:
                    Alignment.Text = "居中";
                    break;
                case DevExpress.Utils.HorzAlignment.Far:
                    Alignment.Text = "右对齐";
                    break;
                case DevExpress.Utils.HorzAlignment.Near:
                    Alignment.Text = "左对齐";
                    break;
            }
           // Alignment = new Controls.ComboBoxData();
        }
        public string Name { set; get; }
        public string Caption { set; get; }
        public string Format { set; get; }
        public bool Visible { get; set; }
        public DevExpress.Utils.FormatType FormatType { get; set; }
        //public DevExpress.Utils.HorzAlignment Alignment { get; set; }
        public Fcdbas.WinUI.Controls.ComboBoxData Alignment { get; set; }
    }
    class GridViewOption
    {
        public bool AutoWidth { get; set; }
        public bool EnableEvenRow { get; set; }
        public bool AutoHeight { get; set; }
        public bool ShowIndicator { get; set; }
        public bool AllowMergeCell { get; set; }
    }
    public class GridFormatCondition
    {
        public GridFormatCondition()
        {

        }
        public string ColumnName { get; set; }
        public FormatConditionEnum FormatCondition { get; set; }
        public String Value1 { get; set; }
        public string Value2 { get; set; }
        public bool ApplyToRow { get; set; }
        public int BackColor { get; set; }
        public int BackColor2 { get; set; }
        public int BorderColor { get; set; }
        public int ForeColor { get; set; }
       // public Font font { get; set; }
       // public DevExpress.Utils.AppearanceOptions Options { get; set; }
        public bool UseBackColor { get; set; }
        public bool UseBordColor { get; set; }
        public bool UseForeColol { get; set; }

    }

}
